{extend name="layout/main" /}

{block name="header"}

{/block}

{block name="content"}
<!--<link rel="stylesheet" href="http://cdn.staticfile.org/webuploader/0.1.5/webuploader.css">-->
<!--<script type="text/javascript" src='http://cdn.staticfile.org/webuploader/0.1.5/webuploader.min.js'></script>-->
<style type="text/css">
    /*body{*/
    /*overflow-x:hidden;*/
    /*overflow-y: auto;*/
    /*width:100%;*/
    /*}*/
    /*.table{*/
    /*display: block;*/
    /*overflow-y: hidden;*/
    /*overflow-x: auto;*/
    /*}*/
    /*.form-control{*/
    /*width: auto;*/
    /*}*/

</style>


<section class="panel">
    <header class="panel-heading">
        <h4>推广算力</h4>
    </header>
    <div class="panel-body" style="padding-bottom: 50px;width:100%;height: auto;overflow: scroll;">
        <table class="table table-bordered table-striped no-margin" style="width:2000px;overflow-x: auto">
            <thead>
            <tr>
                <th class="text-center">序号</th>
                <th class="text-center">直推数</th>
                <th class="text-center">下级持币数</th>
                <th class="text-center">第一代</th>
                <th class="text-center">第二代</th>
                <th class="text-center">第三代</th>
                <th class="text-center">第四代</th>
                <th class="text-center">第五代</th>
                <th class="text-center">第六代</th>
                <th class="text-center">第七代</th>
                <th class="text-center">第八代</th>
                <th class="text-center">第九代</th>
                <th class="text-center">第十代</th>
                <th class="text-center">第十一代</th>
                <th class="text-center">第十二代</th>
                <th class="text-center">第十三代</th>
                <th class="text-center">第十四代</th>
                <th class="text-center">第十五代</th>
                <th class="text-center">操作</th>
            </tr>
            </thead>
            <tbody>
            {foreach $has as $key=>$config}
            <tr>
                <td class="text-center" style="vertical-align: middle; ">{$key+1}</td>
                <td class="text-center" style="vertical-align: middle; ">
                <input type="text" disabled id="_zhitui_{$config['id']}" style="text-align: center" class="form-control"
                       value="{$config['zhitui']}">
                </td>
                <td class="text-center" style="vertical-align: middle; ">
                <input type="number" id="_money_{$config['id']}" style="text-align: center" class="form-control"
                       value="{$config['money']}">
                </td>
                <td class="text-center" style="vertical-align: middle; ">
                    <input type="number" id="_num1_{$config['id']}" style="text-align: center" class="form-control"
                           value="{$config['num1']}">
                </td>
                <td class="text-center" style="vertical-align: middle; ">
                    <input type="number" id="_num2_{$config['id']}" style="text-align: center" class="form-control"
                           value="{$config['num2']}">
                </td>
                <td class="text-center" style="vertical-align: middle; ">
                    <input type="number" id="_num3_{$config['id']}" style="text-align: center" class="form-control"
                           value="{$config['num3']}">
                </td>
                <td class="text-center" style="vertical-align: middle; ">
                    <input type="number" id="_num4_{$config['id']}" style="text-align: center" class="form-control"
                           value="{$config['num4']}">
                </td>
                <td class="text-center" style="vertical-align: middle; ">
                    <input type="number" id="_num5_{$config['id']}" style="text-align: center" class="form-control"
                           value="{$config['num5']}">
                </td>
                <td class="text-center" style="vertical-align: middle; ">
                    <input type="number" id="_num6_{$config['id']}" style="text-align: center" class="form-control"
                      value="{$config['num6']}">
                </td>
                <td class="text-center" st  e="vertical-align: middle; ">
                    <input type="number" id="_num7_{$config['id']}" style="text-align: center" class="form-control"
                           value="{$config['num7']}">
                </td>
                <td class="text-center" style="vertical-align:  middle; ">
                    <input type="number" id="_num8_{$config['id']}" style="text-align: center" class="form-control"
                            value="{$config['num8']}">
                </td>
                <td class="text-center" style="vertasal-align: middle; ">
                    <input type="number" id="_num9_{$config['id']}" style="text-align: center" class="form-control"
                            value="{$config['num9']}">
                </td>
                <td class="text-center" style="vertical-align: middle; ">
                    <input type="number" id="_num10_{$config['id']}" style="text-align: center" class="form-control"
                           value="{$config['num10']}">
                </td>
                <td class="text-center" style="vertical-align: middle; ">
                    <input type="number" id="_num11_{$config['id']}" style="text-align: center" class="form-control"
                           value="{$config['num11']}">
                </td>
                <td class="text-center" style="vertical-align: middle; ">
                    <input type="number" id="_num12_{$config['id']}" style="text-align: center" class="form-control"
                           value="{$config['num12']}">
                </td>
                <td class="text-center" style="vertical-align: middle; ">
                    <input type="number" id="_num13_{$config['id']}" style="text-align: center" class="form-control"
                           value="{$config['num13']}">
                </td>
                <td class="text-center" style="vertical-align: middle; ">
                    <input type="number" id="_num14_{$config['id']}" style="text-align: center" class="form-control"
                           value="{$config['num14']}">
                </td>
                <td class="text-center" style="vertical-align: middle; ">
                    <input type="number" id="_num15_{$config['id']}" style="text-align: center" class="form-control"
                           value="{$config['num15']}">
                </td>
                <td class="text-center" style="vertical-align: middle; ">
                    <a onclick="updateConfigCopy(this)"
                       data-zhitui="{$config['zhitui']}"
                       data-money="{$config['money']}"
                       data-num1="{$config['num1']}"
                       data-num2="{$config['num2']}"
                       data-num3="{$config['num3']}"
                       data-num4="{$config['num4']}"
                       data-num5="{$config['num5']}"
                       data-num6="{$config['num6']}"
                       data-num7="{$config['num7']}"
                       data-num8="{$config['num9']}"
                       data-num9="{$config['num9']}"
                       data-num10="{$config['num10']}"
                       data-num11="{$config['num11']}"
                       data-num12="{$config['num12']}"
                       data-num13="{$config['num13']}"
                       data-num14="{$config['num14']}"
                       data-num15="{$config['num15']}"

                       id-data="{$config['id']}" class="btn btn-xs btn-primary">确认修改</a>
                </td>

            </tr>
            <!-- {/if} -->
            {/foreach}
            </tbody>
        </table>
    </div>
        <br><p></p>
        <h4>算力配置</h4>
        <table class="table table-bordered table-striped no-margin">
            <thead>
            <tr>
                <th class="text-center">序号</th>
                <th class="text-center">数量</th>
                <th class="text-center">算力比(%)</th>
                <th class="text-center">操作</th>
            </tr>
            </thead>
            <tbody>
            {foreach $ore as $k=>$v}
            <tr>
                <td class="text-center" style="vertical-align: middle; ">{$k+1}</td>
                <td class="text-center" style="vertical-align: middle; ">{$v['num']}</td>
                <td class="text-center" style="vertical-align: middle; ">
                    <input type="text" id="_percent{$v['id']}" style="text-align: center" class="form-control" value="{$v['percent']}">
                </td>
                <td class="text-center" style="vertical-align: middle; ">
                    <a onclick="updateConfigCopy1(this)"
                       data-num="{$v['num']}"
                       data-percent="{$v['percent']}"
                       id-data1="{$v['id']}"
                       class="btn btn-xs btn-primary">确认修改</a>
                </td>

            </tr>
            {/foreach}
            </tbody>

        </table>


        <br><p></p>
        <h4>算力加成</h4>
        <table class="table table-bordered table-striped no-margin">
            <thead>
            <tr>
                <th class="text-center">序号</th>
                <th class="text-center">最小天数</th>
                <th class="text-center">最大天数</th>
                <th class="text-center">奖励（%）</th>
                <th class="text-center">操作</th>
            </tr>
            </thead>
            <tbody>
            {foreach $count_plus as $k=>$v}
            <tr>
                <td class="text-center" style="vertical-align: middle; ">{$k+1}</td>

                <td class="text-center" style="vertical-align: middle; ">
                    <input type="text" id="_min{$v['id']}" style="text-align: center" class="form-control" value="{$v['min']}">
                </td>
                <td class="text-center" style="vertical-align: middle; ">
                    <input type="text" id="_max{$v['id']}" style="text-align: center" class="form-control" value="{$v['max']}">
                </td>

                <td class="text-center" style="vertical-align: middle; ">
                    <input type="text" id="_percent_{$v['id']}" style="text-align: center" class="form-control" value="{$v['percen']}">
                </td>
                <td class="text-center" style="vertical-align: middle; ">
                    <a onclick="updateConfigCopy3(this)"
                       data-min="{$v['min']}"
                       data-max="{$v['max']}"
                       data-percent="{$v['percen']}"
                       id-data1="{$v['id']}"
                       class="btn btn-xs btn-primary">确认修改</a>
                </td>

            </tr>
            {/foreach}
            </tbody>

        </table>





    </div>
</section>


{/block}

{block name="footer"}

<script>

    function updateConfigCopy(e) {
        var id = $(e).attr('id-data');

        var zhitui = $('#_zhitui_' +id).val();
        var money = $('#_money_' +id).val();
        var num1 = $('#_num1_' +id).val();
        var num2 = $('#_num2_' +id).val();
        var num3 = $('#_num3_' +id).val();
        var num4 = $('#_num4_' +id).val();
        var num5 = $('#_num5_' +id).val();
        var num6 = $('#_num6_' +id).val();
        var num7 = $('#_num7_' +id).val();
        var num8 = $('#_num8_' +id).val();
        var num9 = $('#_num9_' +id).val();
        var num10 = $('#_num10_' +id).val();
        var num11 = $('#_num11_' +id).val();
        var num12 = $('#_num12_' +id).val();
        var num13 = $('#_num13_' +id).val();
        var num14 = $('#_num14_' +id).val();
        var num15 = $('#_num15_' +id).val();



        $.post("{:url('packageSetsave')}", {
            id: id,
            zhitui: zhitui,
            money: money,
            num1: num1,
            num2: num2,
            num3: num3,
            num4: num4,
            num5: num5,
            num6: num6,
            num7: num7,
            num8: num8,
            num9: num9,
            num10:num10,
            num11:num11,
            num12:num12,
            num13:num13,
            num14:num14,
            num15:num15,


        }, function (data) {
            if (data.code == 1) {
                main.waringAlert(data.message);
            } else {
                main.waringAlert(data.message);
                window.location.reload();
            }
        }, 'json')
    }

    function updateConfigCopy1(e) {
        var id1 = $(e).attr('id-data1');

        var num = $('#_num' +id1).val();
        var percent = $('#_percent' +id1).val();
        $.post("{:url('teamratioupd')}", {
            id: id1,
            num:num,
            percent:percent,
        }, function (data) {
            if (data.code == 1) {
                main.waringAlert(data.message);
            } else {
                main.waringAlert(data.message);
                window.location.reload();
            }
        }, 'json')
    }

    function updateConfigCopy3(e) {
        var id1 = $(e).attr('id-data1');

        var min = $('#_min' +id1).val();
        var max = $('#_max' +id1).val();
        var percent = $('#_percent_' +id1).val();
        $.post("{:url('count_plus')}", {
            id: id1,
            min:min,
            max:max,
            percent:percent,
        }, function (data) {
            if (data.code == 1) {
                main.waringAlert(data.message);
            } else {
                main.waringAlert(data.message);
                window.location.reload();
            }
        }, 'json')
    }




</script>


</script>
{/block}
